package com.hzxy.yiyid.web.module.repository.entity;

import com.hzxy.yiyid.web.common.constants.YiyidConstants;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName SubstandardDrugDo
 * @Description TOOD
 * @Author RAICOM2023
 * @Date 2023/3/6 16:25
 * @Version 1.0
 **/
@Data
@Entity
@Table(name = "substandard_drug")
public class SubstandardDrugDo implements Serializable {
    private static final long serialVersionUID = 2949620791309863480L;

    @Id
    @Column(name = "id")
    @GenericGenerator(
            name = "generator_substandard_drug",
            strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
            parameters = {
                    @Parameter(name = "sequence_name", value = "s_substandard_drug"),
                    @Parameter(name = "initial_value", value = "1"),
                    @Parameter(name = "increment_size", value = "1")
            }
    )
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "generator_substandard_drug")
    private Long id;

    /**
     * 抽查检查时间
     */
    @Column(name = "ccsj")
    private String ccsj;

    /**
     * 批号
     */
    @Column(name = "ph")
    private String ph;

    /**
     * 主体类别
     */
    @Column(name = "ztlb")
    private String ztlb;

    /**
     * 标示生产单位
     */
    @Column(name = "scdw")
    private String scdw;

    /**
     * 抽查检查项目名称
     */
    @Column(name = "xmmc")
    private String xmmc;

    /**
     * 药品名称
     */
    @Column(name = "ypmc")
    private String ypmc;

    /**
     * 规格
     */
    @Column(name = "gg")
    private String gg;

    /**
     * 抽查检查机构统一社会信用代码
     */
    @Column(name = "jgdm")
    private String jgdm;

    /**
     * 有效期
     */
    @Column(name = "yxq")
    private String yxq;

    /**
     * 不合格项目
     */
    @Column(name = "bhgxm")
    private String bhgxm;

    /**
     * 检验机构
     */
    @Column(name = "jyjg")
    private String jyjg;

    /**
     * 检验依据
     */
    @Column(name = "jyyj")
    private String jyyj;

    /**
     * 备注
     */
    @Column(name = "bz")
    private String bz;

    /**
     * 抽查检查类别
     */
    @Column(name = "jclb")
    private String jclb;

    /**
     * 编号
     */
    @Column(name = "bh")
    private String bh;

    /**
     * 检品来源
     */
    @Column(name = "jply")
    private String jply;

    /**
     * 检验结果
     */
    @Column(name = "jcjg")
    private String jcjg;

    /**
     * 统一社会信用代码
     */
    @Column(name = "dm")
    private String dm;

    /**
     * 保存时间
     */
    @Column(name = "save_time")
    @DateTimeFormat(pattern = YiyidConstants.DATE_FORMAT_DEFAULT_VIEW)
    private Date saveTime = new Date();

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    @DateTimeFormat(pattern = YiyidConstants.DATE_FORMAT_DEFAULT_VIEW)
    private Date updateTime;

    public SubstandardDrugDo(){

    }

    public SubstandardDrugDo(String ccsj, String ph, String ztlb, String scdw, String xmmc, String ypmc
            , String gg, String jgdm, String yxq, String bhgxm, String jyjg, String jyyj, String bz, String jclb
            , String bh, String jply, String jcjg, String dm) {
        this.ccsj = ccsj;
        this.ph = ph;
        this.ztlb = ztlb;
        this.scdw = scdw;
        this.xmmc = xmmc;
        this.ypmc = ypmc;
        this.gg = gg;
        this.jgdm = jgdm;
        this.yxq = yxq;
        this.bhgxm = bhgxm;
        this.jyjg = jyjg;
        this.jyyj = jyyj;
        this.bz = bz;
        this.jclb = jclb;
        this.bh = bh;
        this.jply = jply;
        this.jcjg = jcjg;
        this.dm = dm;
        this.saveTime = new Date();
    }
}
